package com.upup.service.impl;

import com.upup.model.Emotion;
import com.upup.service.EmotionService;

import java.util.List;

/**
 * Author: zhiye
 * Description:
 */
public class EmotionServiceImpl implements EmotionService {
    @Override
    public boolean saveEmotion(String username, String place, String thetext, String time, String pic) {
        Emotion emotion =new Emotion();
        emotion.setUsername(username);
        emotion.setPlace(place);
        emotion.setThetext(thetext);
        emotion.setTime(time);
        emotion.setPic(pic);
        emotion.save();
        return true;
    }
    @Override
    public List<Emotion> getEmotions(String place) {
        Emotion emotion = new Emotion();
        List<Emotion> emotions = emotion.where("place",place).findAll();
        return emotions;
    }

}
